﻿<Window x:Class="ResourceBlender_Express.WinEditPO"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:ResourceBlender_Express"
    xmlns:converters="clr-namespace:ResourceBlender_Express.Converters"
    loc:WindowService.EscapeClosesWindow="True"
    Title="PO Data" WindowStartupLocation="CenterOwner"
    MinHeight="310" MinWidth="380" Height="450" Width="400"
    Style="{StaticResource {x:Type Window}}" Icon="/ResourceBlender-Express;component/Resources/images/resourceblender.ico">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Save" Executed="Save" />
        <CommandBinding Command="ApplicationCommands.Close" Executed="CloseWindow" />
        <CommandBinding Command="ApplicationCommands.Help" Executed="ShowHelp" />
    </Window.CommandBindings>
    <Window.Resources>
        <converters:ListToStringConverter x:Key="ListToStringConverter"  />
    </Window.Resources>
    <Grid Margin="6" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition Height="Auto"  />
        </Grid.RowDefinitions>

        <Label Grid.Row="0" Grid.Column="0">Source Comments</Label>
        <TextBox x:Name="txtSourceComments" Grid.Row="0" Grid.Column="1" Text="{Binding ExtractedComments,Converter={StaticResource ListToStringConverter},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" />
        
        <Label Grid.Row="1" Grid.Column="0">References</Label>
        <TextBox x:Name="txtReferences" Grid.Row="1" Grid.Column="1" Text="{Binding References,Converter={StaticResource ListToStringConverter},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" />
        
        <Label Grid.Row="2" Grid.Column="0">Flags</Label>
        <TextBox x:Name="txtFlags" Grid.Row="2" Grid.Column="1" Text="{Binding Flags,Converter={StaticResource ListToStringConverter},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" />
        
        <Label Grid.Row="3" Grid.Column="0">Context</Label>
        <TextBox x:Name="txtContext" Grid.Row="3" Grid.Column="1" Text="{Binding Context,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" />
        
        <Grid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            
            <loc:ImageButton Grid.Column="0" MinWidth="70" Command="ApplicationCommands.Help" Image="Resources/images/question_16.png" ImageLocation="Left" Text="Help" />
            <Button x:Name="btnSave" Grid.Column="2" MinWidth="70" IsDefault="True" Command="ApplicationCommands.Save">Save</Button>
            <Button x:Name="btnCancel" Grid.Column="3" MinWidth="70" IsCancel="True" Command="ApplicationCommands.Close" Margin="2,2,0,2">Cancel</Button>
        </Grid>
    </Grid>
</Window>
